package com.abcdefg.springtrans.service;

import com.abcdefg.springtrans.mapper.UserInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class UserService {
    @Autowired
    private UserInfoMapper userInfoMapper;

//    @Transactional(propagation = Propagation.REQUIRED)
//@Transactional(propagation = Propagation.REQUIRES_NEW)
//@Transactional(propagation = Propagation.SUPPORTS)
//    @Transactional(propagation = Propagation.MANDATORY)
//@Transactional(propagation = Propagation.REQUIRES_NEW)
//@Transactional(propagation = Propagation.NOT_SUPPORTED)
@Transactional(propagation = Propagation.NEVER)
//    @Transactional(propagation = Propagation.NESTED)
    public void registryUser(String name,String password) {
        //插⼊⽤⼾信息
        userInfoMapper.insert(name, password);
        log.info("registryUser注册成功!");
    }
}
